home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / f90 / minval.z / minval
Encoding:
Text File  |  2002-10-03  |  5.5 KB  |  119 lines

  1. MINVAL(3I)                                            Last changed: 4-13-99
  2.  
  3.  
  4. NNAAMMEE
  5.      MMIINNVVAALL - Returns the minimum value in an array
  6.  
  7. SSYYNNOOPPSSIISS
  8.      MMIINNVVAALL (([AARRRRAAYY==]_a_r_r_a_y [,,[DDIIMM==]_d_i_m] [,,[MMAASSKK==]_m_a_s_k]))
  9.  
  10. IIMMPPLLEEMMEENNTTAATTIIOONN
  11.      UNICOS, UNICOS/mk, IRIX systems
  12.  
  13.      CF90, MIPSpro 7 Fortran 90
  14.  
  15. SSTTAANNDDAARRDDSS
  16.      Fortran
  17.  
  18. DDEESSCCRRIIPPTTIIOONN
  19.      The MMIINNVVAALL intrinsic function can be used for array reduction.  It
  20.      returns the minimum value of the elements of _a_r_r_a_y along dimension _d_i_m
  21.      corresponding to the true elements of _m_a_s_k.  It accepts the following
  22.      arguments:
  23.  
  24.      _a_r_r_a_y     Must be of type integer or real.  It must not be scalar.
  25.  
  26.      _d_i_m       Must be a scalar integer value in the range 1 <= _d_i_m <= _n,
  27.                where _n is the rank of _a_r_r_a_y.  The corresponding actual
  28.                argument must not be an optional dummy argument.
  29.  
  30.      _m_a_s_k      Must be of type logical and must be conformable with _a_r_r_a_y.
  31.  
  32.      MMIINNVVAALL is a transformational intrinsic function.  The name of this
  33.      intrinsic cannot be passed as an argument.
  34.  
  35. NNOOTTEESS
  36.      On UNICOS systems, both execution speed and the number of bits used in
  37.      mathematical operations are affected when compiling with
  38.      ff9900 --OO ffaassttiinntt, which is the default setting.  For more information,
  39.      see _C_F_9_0 _C_o_m_m_a_n_d_s _a_n_d _D_i_r_e_c_t_i_v_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l.
  40.  
  41. RREETTUURRNN VVAALLUUEESS
  42.      The result is of the same type as _a_r_r_a_y.  It is scalar if _d_i_m is
  43.      absent or _a_r_r_a_y has rank one.  Otherwise, the result is an array of
  44.      rank _n-1 and of shape
  45.      (_d , _d , ..., _d     , _d     , ..., _d ),
  46.        1   2        _d_i_m-1   _d_i_m+1        _n
  47.      where (_d , _d , ..., _d )
  48.              1   2        _n
  49.      is the shape of _a_r_r_a_y.
  50.  
  51.      The result of MMIINNVVAALL((_a_r_r_a_y)) has a value equal to the minimum value of
  52.      all the elements of _a_r_r_a_y or has the value of the positive number of
  53.      the largest magnitude supported for numbers of the data type of _a_r_r_a_y
  54.      if _a_r_r_a_y is a zero-sized array.
  55.  
  56.      The result of MMIINNVVAALL((_a_r_r_a_y,,MMAASSKK==_m_a_s_k)) has a value equal to the minimum
  57.      value of all the elements of _a_r_r_a_y corresponding to true elements of
  58.      _m_a_s_k or has the value of the positive number of the largest magnitude
  59.      supported for numbers of the data type of _a_r_r_a_y if there are no true
  60.      elements.
  61.  
  62.      If _a_r_r_a_y has rank one, MMIINNVVAALL((_a_r_r_a_y,,_d_i_m[,,_m_a_s_k])) has a value equal to
  63.      that of MMIINNVVAALL((_a_r_r_a_y[,,MMAASSKK==mask])).  Otherwise, the value of element
  64.      (_s , _s , ..., _s     , _s     , ..., _s )
  65.        1   2        _d_i_m-1   _d_i_m+1        _n
  66.      of MMIINNVVAALL((_a_r_r_a_y,,_d_i_m[,,_m_a_s_k])) is equal to
  67.      MMIINNVVAALL((_a_r_r_a_y(_s , _s , ..., _s     , : , _s     , ..., _s ),
  68.                    1   2        _d_i_m-1       _d_i_m+1        _n
  69.       [,, MMAASSKK==_m_a_s_k((_s , _s , ..., _s     , : , _s     , ..., _s )]).
  70.                     1   2        _d_i_m-1       _d_i_m+1        _n
  71.  
  72.      On UNICOS and UNICOS/mk systems, MMIINNVVAALL returns the value of
  73.      ++HHUUGGEE((_a_r_r_a_y)) for all zero-sized arrays.  On IRIX systems, MMIINNVVAALL
  74.      returns the value of ++IINNFFIINNIITTYY for real, zero-sized arrays.  A request
  75.      for interpretation of the Fortran 95 standard may change one of these
  76.      return values for a real array in a future release.
  77.  
  78. EEXXAAMMPPLLEESS
  79.      Example 1:  The value of MMIINNVVAALL(( ((// 11,, 22,, 33 //)) )) is 1.
  80.  
  81.      Example 2:  Assume that C is the array [10,-100,10].  Then
  82.      MMIINNVVAALL((CC,, MMAASSKK==CC ..LLTT.. 00)) finds the minimum of the negative elements of
  83.      C (which is -100) and MMIINNVVAALL((CC,, MMAASSKK==CC ..GGTT.. 1100)) returns the largest
  84.      possible integer because there are no true elements using the mask.
  85.  
  86.      Example 3:  Assume that BB is the following array:
  87.  
  88.         | 1 3 5 |
  89.  
  90.         | 2 4 6 |
  91.  
  92.      The following are true:
  93.  
  94.           MMIINNVVAALL((BB,, DDIIMM==11)) is [1, 3, 5]
  95.  
  96.           MMIINNVVAALL((BB,, DDIIMM==22)) is [1, 2]
  97.  
  98.           MMIINNVVAALL((BB)) is 1
  99.  
  100.      Example 4:  Assume that NN is the following array:
  101.  
  102.         | 0 1 2 3 |
  103.  
  104.         | 4 5 6 7 |
  105.  
  106.         | 8 9 0 1 |
  107.  
  108.      In an array section reference, the following are true:
  109.  
  110.           MMIINNVVAALL((NN((22::33,,22::44)),,MMAASSKK==NN((22::33,,22::44))..NNEE..00)) is 1
  111.  
  112.           MMIINNVVAALL((NN((22::33,,22::44)),,DDIIMM==11,,NN((22::33,,22::44))..NNEE..00)) is [5, 6, 1]
  113.  
  114.           MMIINNVVAALL((NN((22::33,,22::44)),,DDIIMM==22,,NN((22::33,,22::44))..NNEE..00)) is [5, 1]
  115.  
  116. SSEEEE AALLSSOO
  117.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed version of this
  118.      man page.
  119.